var proxyMatch = (function () {
	var obj = {};
	obj.types = { "DIRECT": "DIRECT", "PROXY": "PROXY", "HTTP": "HTTP", "HTTPS": "HTTPS", "SOCKS": "SOCKS", "SOCKS4": "SOCKS4", "SOCKS5": "SOCKS5" };
	obj.matchPacProxy = function (ruleList, url, host) {
		return obj.buildPacProxy(obj.matchProxyList(ruleList, url, host));
	};
	obj.matchProxyList = function (ruleList, url, host) {
		for (var i in ruleList) {
			var rule = ruleList[i];
			for (var j in rule.include_list) {
				var pattern = rule.include_list[j];
				if (pattern == "*" || host == pattern.toLowerCase() || (new RegExp("." + pattern + "$", "i")).test(host)) {
					return rule.proxy_list;
				}
			}
		}
		return [];
	};
	obj.buildPacProxy = function (proxyList) {
		var rows = [];
		proxyList.forEach(function (item) {
			var type = item.type.toUpperCase();
			switch (type) {
				case obj.types.HTTP:
				case obj.types.HTTPS:
				case obj.types.SOCKS:
				case obj.types.SOCKS4:
					rows.push(type + " " + item.host + ":" + item.port);
					break;
			}
		});
		rows.push(obj.types.DIRECT);
		return rows.join("; ");
	};
	return obj;
})();
var ruleList = [{"proxy_url":"","proxy_list":[{"type":"HTTPS","host":"hk-hkt-06.ghelper.net","port":3389},{"type":"HTTPS","host":"hkbn-home-01.ghelper.net","port":3389},{"type":"HTTPS","host":"hk-hkt-02.ghelper.net","port":3389}],"include_url":"","include_list":["about.google","android.com","chrome.com","onedrive.com","onedrive.live.com"],"exclude_url":"","exclude_list":[]},{"proxy_url":"","proxy_list":[{"type":"HTTPS","host":"kr-cu.ghelper.net","port":3389},{"type":"HTTPS","host":"hkbn-home-01.ghelper.net","port":3389},{"type":"HTTPS","host":"hk-hkt-02.ghelper.net","port":3389}],"include_url":"","include_list":["scholar.google.com","scholar.google.com.hk"],"exclude_url":"","exclude_list":[]},{"proxy_url":"","proxy_list":[{"type":"HTTPS","host":"www.9ine7even.xyz","port":8080},{"type":"HTTPS","host":"www.niubenshan.xyz","port":443},{"type":"HTTPS","host":"www.wangdefa.club","port":8080}],"include_url":"","include_list":["ggpht.com","gmail.com","golang.org","goo.gl","google.ae","google.as","google.at","google.be","google.bi","google.ca","google.cd","google.ch","google.cl","google.co.cr","google.co.gg","google.co.hu","google.co.id","google.co.il","google.co.in","google.co.je","google.co.jp","google.co.kr","google.co.mu","google.co.nz","google.co.th","google.co.uk","google.co.ve","google.com","google.com.ar","google.com.au","google.com.br","google.com.co","google.com.eg","google.com.hk","google.com.kw","google.com.mt","google.com.mx","google.com.my","google.com.nf","google.com.ni","google.com.np","google.com.pa","google.com.pe","google.com.py","google.com.ru","google.com.sa","google.com.sg","google.com.tj","google.com.tr","google.com.tw","google.com.ua","google.com.uy","google.com.vn","google.cz","google.de","google.dk","google.es","google.fi","google.fm","google.fr","google.gl","google.gm","google.gr","google.hn","google.ie","google.it","google.kz","google.li","google.lt","google.lv","google.md","google.ms","google.mw","google.nl","google.no","google.pl","google.pn","google.pr","google.pt","google.ro","google.rs","google.ru","google.rw","google.se","google.sh","google.sm","google.td","google.uz","google.vg","googleapis.com","googlecode.com","googlegroups.com","googleratings.com","googletagmanager.com","googleusercontent.com","gstatic.com","t.co","tensorflow.org","thinkwithgoogle.com","wikimedia.org","wikipedia.org","accounts.youtube.com"],"exclude_url":"","exclude_list":[]}];
function FindProxyForURL(url, host) {
	return proxyMatch.matchPacProxy(ruleList, url, host);
};